Dockerization for 03-rwslotmachine#58
Merged
razvand merged 3 commits intoopen-education-hub:mainfrom May 17, 2025
Merged
Conversation
razvand
requested changes
May 17, 2025
...ations-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/sol/Makefile
Outdated
Show resolved
Hide resolved
...ations-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/sol/Makefile
Outdated
Show resolved
Hide resolved
...ations-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/sol/Makefile
Outdated
Show resolved
Hide resolved
...ations-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/sol/Makefile
Outdated
Show resolved
Hide resolved
...ations-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/sol/Makefile
Outdated
Show resolved
Hide resolved
...ations-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/sol/Makefile
Outdated
Show resolved
Hide resolved
...s-and-defensive-strategies/defense-mechanisms/activities/03-rwslotmachine3/deploy/Dockerfile
Outdated
Show resolved
Hide resolved
razvand
requested changes
May 17, 2025
Contributor
razvand
left a comment
There was a problem hiding this comment.
Use present tense.
Use your full name in the commit messages, i.e. use Cosmin Tanasa <tanasa.cosminandrei@gmail.com> instead of cosmintanasa47 <tanasa.cosminandrei@gmail.com>
cb76137 to
f893418
Compare
Contributor
|
@cosmintanasa47 , use athe |
…ckerization Add a multi-stage Dockerfile that builds the 32bit binary for the rwslotmachine3.c file and runs the binary on port 31346. Local port for build container is 32000 and the runtime container uses port 32001. Add a Makefile that handles the Dockerfile's build, run and stop. It works on my computer. Disk usage seems to be too high. May need improvements. Resolves: open-education-hub#50 Signed-off-by: Cosmin Tanasa <tanasa.cosminandrei@gmail.com>
This Makefile is used inside the containers to build the executable, check if the executable exists and also to check if the executable is running on port 31346. Resolves: open-education-hub#50 Signed-off-by: Cosmin Tanasa <tanasa.cosminandrei@gmail.com>
README file so everyone knows how to use the containers. Resolves: open-education-hub#50 Signed-off-by: Cosmin Tanasa <tanasa.cosminandrei@gmail.com>
razvand
requested changes
May 17, 2025
Contributor
razvand
left a comment
There was a problem hiding this comment.
Reviewed-by: Razvan Deaconescu razvand@unikraft.io
Approved-by: Razvan Deaconescu razvand@unikraft.io
razvand
approved these changes
May 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think it works. Tested the containers and worked on my computer. Disk usage seems to be too high. May need improvements. Don't know if this is enough to do the challenge/activity.
Prerequisite Checklist
Description of changes
Added a Dockerfile that creates the environment to build and run the executable.
Added a Makefile to handle the Dockerfile (build, run, etc.)
Added a Makefile that is uploaded to the container and builds the executable, checks for the existence of the executable and checks if the executable is operating on port 31346.
With rwslotmachine3_runtime-cnt container running, I tested the communication with the app using nc and this was the result:
nc 127.0.0.1 32000
==== www / rww ====
|>2
Input slot index: 3
Input new slot value: 3
Slot[3]:= 0003
==== www / rww ====
|> 1
==== www / rww ====
|> 3
nc 127.0.0.1 32000
==== www / rww ====
|> 1
Input slot index: 3
Slot[3]: 0000
==== www / rww ====
|> 3
32000 - local port linked with container port 31346.